package com.umeng.analytics.pro;

import java.io.IOException;
import java.io.InputStream;
import java.io.ObjectInputStream;
import java.io.ObjectOutputStream;
import java.io.OutputStream;
import java.io.Serializable;
import java.util.BitSet;
import java.util.Collections;
import java.util.EnumMap;
import java.util.EnumSet;
import java.util.HashMap;
import java.util.Iterator;
import java.util.Map;

public class bo implements cg, Serializable, Cloneable {
    static class a extends dp {
        private a() {

        }

        public void a(df arg6, bo arg7) throws cm {
            int v4 = 11;
            arg6.j();
            while (true) {
                da v0 = arg6.l();
                if (v0.b == 0) {
                    break;
                }

                switch (v0.c) {
                    case 1: {
                        if (v0.b == v4) {
                            arg7.a = arg6.z();
                            arg7.a(true);
                            break;
                        }

                        di.a(arg6, v0.b);
                        break;
                    }
                    case 2: {
                        if (v0.b == 10) {
                            arg7.b = arg6.x();
                            arg7.b(true);
                            break;
                        }

                        di.a(arg6, v0.b);
                        break;
                    }
                    case 3: {
                        if (v0.b == v4) {
                            arg7.c = arg6.z();
                            arg7.c(true);
                            break;
                        }

                        di.a(arg6, v0.b);
                        break;
                    }
                    default: {
                        di.a(arg6, v0.b);
                        break;
                    }
                }
                arg6.m();
            }

            arg6.k();
            if (!arg7.h()) {
                throw new dg("Required field \'ts\' was not found in serialized data! Struct: " + this.toString());
            }

            arg7.l();
        }

        public void a(df arg1, cg arg2) throws cm {
            this.b(arg1, ((bo) arg2));
        }

        public void b(df arg3, bo arg4) throws cm {
            arg4.l();
            arg3.a(bo.m());
            if (arg4.a != null && (arg4.e())) {
                arg3.a(bo.n());
                arg3.a(arg4.a);
                arg3.c();
            }

            arg3.a(bo.o());
            arg3.a(arg4.b);
            arg3.c();
            if (arg4.c != null) {
                arg3.a(bo.q());
                arg3.a(arg4.c);
                arg3.c();
            }

            arg3.d();
            arg3.b();
        }

        public void b(df arg1, cg arg2) throws cm {
            this.a(arg1, ((bo) arg2));
        }
    }

    static class b implements do0 {

        private b() {

        }

        public a a() {
            return new a();
        }

        public dn b() {
            return this.a();
        }
    }

    static class c extends dq {
        private c() {

        }

        public void a(df arg3, bo arg4) throws cm {
            ((dl) arg3).a(arg4.b);
            ((dl) arg3).a(arg4.c);
            BitSet v0 = new BitSet();
            if (arg4.e()) {
                v0.set(0);
            }

            ((dl) arg3).a(v0, 1);
            if (arg4.e()) {
                ((dl) arg3).a(arg4.a);
            }
        }

        public void a(df arg1, cg arg2) throws cm {
            this.a(arg1, ((bo) arg2));
        }

        public void b(df arg4, bo arg5) throws cm {
            arg5.b = ((dl) arg4).x();
            arg5.b(true);
            arg5.c = ((dl) arg4).z();
            arg5.c(true);
            if (((dl) arg4).b(1).get(0)) {
                arg5.a = ((dl) arg4).z();
                arg5.a(true);
            }
        }

        public void b(df arg1, cg arg2) throws cm {
            this.b(arg1, ((bo) arg2));
        }
    }

    static class d implements do0 {
        private d() {

        }

        public c a() {
            return new c();
        }

        public dn b() {
            return this.a();
        }
    }

    public enum bo$e implements cn {
        VALUE((short) 1, "value"),
        TS((short) 2, "ts"),
        GUID((short) 3, "guid");

        private static final Map<String, bo$e> d;
        private final short e;
        private final String f;

        static {
            d = new HashMap();
            Iterator it = EnumSet.allOf(bo$e.class).iterator();
            while (it.hasNext()) {
                bo$e eVar = (bo$e) it.next();
                d.put(eVar.b(), eVar);
            }
        }

        private bo$e(short s, String str) {
            this.e = s;
            this.f = str;
        }

        public static bo$e a(int i) {
            switch (i) {
                case 1:
                    return VALUE;
                case 2:
                    return TS;
                case 3:
                    return GUID;
                default:
                    return null;
            }
        }

        public static bo$e a(String str) {
            return d.get(str);
        }

        public static bo$e b(int i) {
            bo$e a = a(i);
            if (a != null) {
                return a;
            }
            throw new IllegalArgumentException("Field " + i + " doesn't exist!");
        }

        public final short a() {
            return this.e;
        }

        public final String b() {
            return this.f;
        }
    }

    public String a;
    public long b;
    public String c;
    public static final Map d;
    private static final long e = 7501688097813630241L;
    private static final dk f;
    private static final da g;
    private static final da h;
    private static final da i;
    private static final Map<Class<? extends dn>, do0> j;
    private static final int k = 0;
    private byte l;
    private bo$e[] m;

    static {
        f = new dk("ImprintValue");
        g = new da("value", (byte) 11, (short) 1);
        h = new da("ts", (byte) 10, (short) 2);
        i = new da("guid", (byte) 11, (short) 3);
        HashMap v0 = new HashMap();
        j = ((Map) v0);
        ((Map) v0).put(dp.class, new b());
        bo.j.put(dq.class, new d());
        EnumMap v0_1 = new EnumMap(e.class);
        ((Map) v0_1).put(bo$e.VALUE, new cs("value", (byte) 2, new ct((byte) 11)));
        ((Map) v0_1).put(bo$e.TS, new cs("ts", (byte) 1, new ct((byte) 10)));
        ((Map) v0_1).put(bo$e.GUID, new cs("guid", (byte) 1, new ct((byte) 11)));
        d = Collections.unmodifiableMap(((Map) v0_1));
        cs.a(bo.class, bo.d);
    }

    public bo(bo arg4) {
        this.l = 0;
        this.m = new bo$e[]{bo$e.VALUE};
        this.l = arg4.l;
        if (arg4.e()) {
            this.a = arg4.a;
        }

        this.b = arg4.b;
        if (arg4.k()) {
            this.c = arg4.c;
        }
    }

    public bo() {
        this.l = 0;
        this.m = new bo$e[]{bo$e.VALUE};
    }

    public bo(long arg2, String arg4) {
        this();
        this.b = arg2;
        this.b(true);
        this.c = arg4;
    }

    public void a(df arg3) throws cm {
        bo.j.get(arg3.D()).b().b(arg3, ((cg) this));
    }

    private void a(ObjectInputStream arg3) throws IOException, ClassNotFoundException {
        try {
            this.l = 0;
            this.a(new cz(new dr(((InputStream) arg3))));
            return;
        } catch (cm v0) {
            throw new IOException(v0.getMessage());
        }
    }

    private void a(ObjectOutputStream arg3) throws IOException {
        try {
            this.b(new cz(new dr(((OutputStream) arg3))));
            return;
        } catch (cm v0) {
            throw new IOException(v0.getMessage());
        }
    }

    public bo$e a(int arg2) {
        return bo$e.a(arg2);
    }

    public bo a() {
        return new bo(this);
    }

    public bo a(long arg2) {
        this.b = arg2;
        this.b(true);
        return this;
    }

    public bo a(String arg1) {
        this.a = arg1;
        return this;
    }

    public void a(boolean arg2) {
        if (!arg2) {
            this.a = null;
        }
    }

    public void b(df arg3) throws cm {
        bo.j.get(arg3.D()).b().a(arg3, ((cg) this));
    }

    public void b(boolean arg3) {
        this.l = cd.a(this.l, 0, arg3);
    }

    public bo b(String arg1) {
        this.c = arg1;
        return this;
    }

    public cn b(int arg2) {
        return this.a(arg2);
    }

    public void b() {
        this.a = null;
        this.b(false);
        this.b = 0;
        this.c = null;
    }

    public String c() {
        return this.a;
    }

    public void c(boolean arg2) {
        if (!arg2) {
            this.c = null;
        }
    }

    public void d() {
        this.a = null;
    }

    public boolean e() {
        boolean v0 = this.a != null ? true : false;
        return v0;
    }

    public long f() {
        return this.b;
    }

    public void g() {
        this.l = cd.b(this.l, 0);
    }

    public boolean h() {
        return cd.a(this.l, 0);
    }

    public String i() {
        return this.c;
    }

    public void j() {
        this.c = null;
    }

    public boolean k() {
        boolean v0 = this.c != null ? true : false;
        return v0;
    }

    public void l() throws cm {
        if (this.c == null) {
            throw new dg("Required field \'guid\' was not present! Struct: " + this.toString());
        }
    }

    static dk m() {
        return bo.f;
    }

    static da n() {
        return bo.g;
    }

    static da o() {
        return bo.h;
    }

    public cg p() {
        return this.a();
    }

    static da q() {
        return bo.i;
    }

    public String toString() {
        StringBuilder v1 = new StringBuilder("ImprintValue(");
        int v0 = 1;
        if (this.e()) {
            v1.append("value:");
            if (this.a == null) {
                v1.append("null");
            } else {
                v1.append(this.a);
            }

            v0 = 0;
        }

        if (v0 == 0) {
            v1.append(", ");
        }

        v1.append("ts:");
        v1.append(this.b);
        v1.append(", ");
        v1.append("guid:");
        if (this.c == null) {
            v1.append("null");
        } else {
            v1.append(this.c);
        }

        v1.append(")");
        return v1.toString();
    }
}

